﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace LabMS.Web.BaseData
{
    public partial class EditCourse :Base.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            strPageUserType.Add("mana");
            strPagePrivilege.Add("KCSJ");

            if (!IsPostBack)
            {
                if (Request.QueryString["ID"] == null)
                {
                    Common.JShelper.JSAlert(this.Page, "", "你无权查看此页面！");
                }
                else
                {
                    int ID = int.Parse(Request.QueryString["ID"].ToString());
                    InitBind(ID);
                    tbCode.Attributes.Add("readOnly","true");
                }
            }
        }

        /// <summary>
        /// 页面初始化
        /// </summary>
        protected void InitBind(int ID)
        {
            LabMS.BLL.Course BCourse = new LabMS.BLL.Course();
            LabMS.Model.Course MCourse = new LabMS.Model.Course();
            MCourse = BCourse.GetModel(ID);
            tbCode.Text = MCourse.Course_Code;
            tbName.Text = MCourse.Course_Name;
            tbnEnglishName.Text = MCourse.EnglishName;
            courseID.Value = MCourse.ID.ToString();
            if (MCourse.Course_ExprientHouse != null)
            {
                tbHour.Text = MCourse.Course_ExprientHouse.Value.ToString();
            }
            tbCourseHouse.Text = MCourse.Course_House;
        }
    }
}
